package com;

import com.hos.db.create.art.ArticleContentEntity;
import com.hos.db.create.ill.IllOptionTable;
import com.hos.net.req.art.ArtCreateReq;
import com.hos.operation.push.gtui.PushTest;
import com.hos.utile.DLog;
import com.hos.utile.JsonUtile;
import com.net.test.HWPush;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by guom on 2019/4/12.
 */
public class TestMain {
    public static void main(String[] args) {
        test01();
    }

    //推送和离线推送
    private static void test01() {
        PushTest.getInstance().pushTest();
    }

    //华为推送
    private static void test02() {
        new HWPush().onReq();
        // new HWPush().test();
    }

    private static void test0() {
        List<String[]> list = IllOptionTable.getOptions();
        String json = JsonUtile.obj2Json(list);
        DLog.e(json);
    }

    public static void test1() {
        String artMsg = "1233333----\"-------\"+1234";
        DLog.e(artMsg);

        String t1 = "\\";
        String t2 = "\"";
        String t3 = "'";
        String t4 = "&quot;";

        DLog.e(t1 + t2);
        String artMsg1 = artMsg.replaceAll("\"", t4);
        DLog.e(artMsg1 + artMsg.equals(artMsg1));

    }

    public static void test() {
        ArtCreateReq req = new ArtCreateReq();
        req.token = "977f622772fdaa71515736a121e7dfba";
        req.service = "hos.sys.art.add";
        req.artTitle = "测试";
        ArrayList<ArticleContentEntity> rs = new ArrayList<ArticleContentEntity>();
        ArticleContentEntity e = new ArticleContentEntity();
        e.artType = 3;
        e.artMsg = "<p><br/></p><p><span style=\"color: rgb(51, 51, 51); \n" +
                " font-family: arial; text-align: justify; background-color: rgb(255, 255, 255);\n" +
                " \">国家卫生健康委员会在青岛召开“互联网+医疗健康”发展及便民惠民 服务新闻发布会。\n" +
                " 国家卫生健康委员会规划发展与信息化司司长毛群安就全国“互联网+医疗健康”发展及便民惠民服务总体情况进\n" +
                " 行了 介绍，山东省卫生健康委员会党组书记、主任袭燕介绍了山东省“互联网+医疗健康”发展及便民惠民服务情况\n" +
                " 。山东省立第三医院院长 吕涌涛受邀参加了本次发布会，在会上向全国媒体介绍了省立三院“互联网+医联体\n" +
                " ”的工作情况，并就相关问题回答了记者提问。</span></p>" +
                "<h2 style=\"margin: 0px; padding: 0px; line-height: 40px; font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, 宋体; font-size: 28px; font-weight: 700;\">新疆：全力推进“互联网+医疗健康”服务新模式</h2><p><img style=\"border-radius: 50%; border: 0px currentColor; border-image: none; width: 32px; height: 32px;\" src=\"https://timg01.bdimg.com/timg?pacompress&imgtype=0&sec=1439619614&autorotate=1&di=8d62dc7312ed5947b41aeadd6f5806a6&quality=90&size=b200_200&src=http%3A%2F%2Fbos.nj.bpc.baidu.com%2Fv1%2Fmedia";
        rs.add(e);
        req.artContents = rs;
        req.artImgCover = "http://hfhos.oss-cn-beijing.aliyuncs.com/images/head/fd165b175c2c187954f161686ebead88";
        String jsonContents = JsonUtile.obj2Json(req.artContents);
        String json = JsonUtile.obj2Json(req);
        //
        List<ArticleContentEntity> artContents = (List<ArticleContentEntity>) JsonUtile.json2Obj(jsonContents,
                List.class, ArticleContentEntity.class);
        DLog.e("-------");
        DLog.e(json);
    }
}
